Resend Notification
Notifications with the payment or payout status can be requested via the endpoint api.
HTTP Request via SSL
POST '/api/v1/da/resend_notifications'
Header Parameters
| Parameter | Mandatory | Description |
|---|---|---|
| Authorization | yes | "Bearer merchant_private_key" - The api key as a string. |
| Content-Type | yes | All request bodies should have content type application/json and be valid JSON. |
Request Body Parameters
| Parameter | Mandatory | Description |
|---|---|---|
| payment_token | conditional | Payment token. Required if order_number is not present. |
| order_number | conditional | Order number. Required if payment_token is not present. |
| session_token | yes | Authorization token |
⚠️ At least one of
payment_tokenororder_numbermust be provided.
If both are provided, both will be used to identify the transaction.
If onlyorder_numberis provided, the latest payout transaction for that order will be used.
Response Parameters
| Parameter | Description |
|---|---|
| success | true/false |
| result | 0/1 |
| status | The HTTP status code of the response |
| errors | A hash with the errors |
- Shell
- Python
- PHP
- Java
curl "https://business.payments.defexa.io/api/v1/da/resend_notifications" \
-H "Authorization: Bearer merchant_private_key" \
-H "Content-Type: application/json" \
-d '{
"session_token": "f3a728b408fadd87f",
"payment_token": "cb8292c06dead5dd8"
}'from django.http import HttpResponseRedirect, HttpResponse
import requests
import json
def pay(request):
payload = {
"session_token": request["session_token"],
"payment_token": request["payment_token"],
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer merchant_private_key'
}
return requests.post('<ApiUrl />api/v1/da/resend_notifications', json=payload, headers=headers)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://business.payments.defexa.io/api/v1/da/resend_notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer merchant_private_key",
"Content-Type: application/json"
),
CURLOPT_POSTFIELDS => json_encode([
"session_token" => "f3a728b408fadd87f",
"payment_token" => "cb8292c06dead5dd8"
]),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(
MediaType.parse("application/json"),
"{\n" +
" \"payment_token\": \"f3a728b408fadd87f\",\n" +
" \"session_token\": \"f3a728b408fadd87f\"\n" +
"}"
);
Request request = new Request.Builder()
.url("https://business.payments.defexa.io/api/v1/da/resend_notifications")
.post(body)
.addHeader("Authorization", "Bearer merchant_private_key")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();Return status 200 and JSON:
{
"success": true,
"result": 0,
"status": 200
}
Return status 403 invalid token or payment not found and JSON:
{
"success": false,
"result": 1,
"status": 403,
"errors": [
{
"code": "payment_not_found"
}
]
}
Return status 403 missing required parameters and JSON:
{
"success": false,
"result": 1,
"status": 403,
"errors": [
{
"code": "missing_required_params"
}
]
}
Return status 403 callback_url not found and JSON:
{
"success": false,
"result": 1,
"status": 403,
"errors": [
{
"code": "callback_url_not_found"
}
]
}
Return status 403 notification in progress and JSON:
{
"success": false,
"result": 1,
"status": 403,
"errors": [
{
"code": "notification_in_progress"
}
]
}